package war2100.editor.menu.handler;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

public class ExitHandler implements ActionListener {

	@Override
	public void actionPerformed(ActionEvent arg0) {
		int n;
		
		String[] yesNoOptions = { "Ja", "Nein" };

		n = JOptionPane.showOptionDialog(null, "Editor wirklich schließen?", "Beenden", JOptionPane.YES_NO_CANCEL_OPTION,
				JOptionPane.QUESTION_MESSAGE, null, yesNoOptions, yesNoOptions[0]);
	
		if (n == JOptionPane.YES_OPTION) {
			System.exit(1);
		}

	}

}
